// pages/creditCardCreateStep2/index.js
import { inputgetName } from '../../utils/inputBothBind.js'

Page({
  data: {
    stepText: ["1.卡号信息", "2.安全码", "3.信用卡有效期"],
    cvn2:'789',
    step1Data:null
  },
  inputgetName: inputgetName,
  toNext:function() {
    if(!this.data.cvn2) {
      wx.showToast({
        title: '请填写完整',
        icon: 'none'
      })
      return
    }
    let tmp = []
    for (let k in this.data.step1Data) {
      tmp.push(`${k}=${this.data.step1Data[k]}`)
    }
    let tmp1 = tmp.join("&")
    wx.navigateTo({
      url: `/pages/creditCardCreateStep3/index?cvn2=${this.data.cvn2}&${tmp1}`,
    })
  },
  onLoad: function (options) {
    this.setData({
      step1Data: options,
      cvn2: "999"
    })
  }
})